$(function  () {
	var num = 0;
	function run () {

		$('.img_list').eq(num).fadeIn().siblings().fadeOut();

		$('.click_list').eq(num).css('background', '#657C87').siblings().css('background', '#fff');

		num++;

		if(num==$('.img_list').length){
			num=0;
		}
		
	}

	$('.car').hover(function() {
		$('.car_meu').stop(true,true).slideDown("quick")
	}, function() {
		$('.car_meu').stop(true,true).slideUp("quick")
	});

	$('.text').focus(function(event) {
		$('.text').css('outline','none')
		$('.text').css('border-color','#FF6700')
		$('.shuru').siblings('.btn').css('border-color','#FF6700')
		$('.text_tip').show()
		$('.text_bq1').hide()
		$('.text_bq2').hide()
	});
	
	$('.text').blur(function(event) {
		$('.text').css('border-color','')
		$('.shuru').siblings('.btn').css('border-color','')
		$('.text_tip').hide()
		$('.text_bq1').show()
		$('.text_bq2').show()
	});
	
	$('.roll_top_mid_dh').hover(function() {
		// $(this).children('a').css('color','#FF6700');
		$('.dh_meu').stop(true,true).slideDown('fast')
	}, function() {
		// $(this).children('a').css('color','');
		$('.dh_meu').stop(true,true).slideUp('fast')/* Stuff to do when the mouse leaves the element */
	});

	$('#mp').mouseover(function(event) {
		$('.dh_meu_mid').show()
		$('.dh_meu_mid1').hide()
	});

	$('#hm').mouseover(function(event) {
		$('.dh_meu_mid1').siblings('.dh_meu_mid').hide()
		$('.dh_meu_mid1').show()
	});

	$(".list").mouseover(function(){
    		$(this).css("background-color","#FF6700");
    		$(this).children("div").show();
    		$(this).children("div").css( '-webkit-box-shadow','2px 5px 10px #E0E0E0')
  		});
  	
  	$(".list").mouseout(function(){
    	$(".list").css("background-color","");
    	$(this).children("div").hide();
  	});

	time = setInterval(run, 5000);

	$('.roll_mid1').hover(function() {
		clearInterval(time);
	}, function() {
		time = setInterval(run, 5000);
	});


	$('.click_list').click(function(event) {
		num = $(this).index();
		run();
	});

	$('#click_right').click(function(event) {
		run()
	});

	$("#click_right").hover(function() {
		$("#click_right").css("background-color","#746B55");
  		$("#click_right").css("color","#FFF");
	}, function() {
		$("#click_right").css("background-color","");
  		$("#click_right").css("color","");/* Stuff to do when the mouse leaves the element */
	});

	$("#click_left").hover(function() {
		$("#click_left").css("background-color","#746B55");
  		$("#click_left").css("color","#FFF");
	}, function() {
		$("#click_left").css("background-color","");
  		$("#click_left").css("color","");/* Stuff to do when the mouse leaves the element */
	});

	$('#click_left').click(function(event) {
		if(num==1){
			num = $('.img_list').length-1;
		}else if(num==0){
			num = $('.img_list').length-2;
		}else{
			num-=2;
		}
		
		run();
	});

	$('.roll_star_top_right_2').mouseover(function(event) {
		/* Act on the event */
	});

	$('.roll_star_top_right_2').click(function(event) {
		$('.roll_star_buttom_1').animate({left:'-1234px'}, 500)
		$('.roll_star_top_right_1').css('color', '#B1B0B0');
		$('.roll_star_top_right_2').css('color', '#E0E0E0');
	});

	$('.roll_star_top_right_1').click(function(event) {
		$('.roll_star_buttom_1').animate({left:'0px'}, 500)
		$('.roll_star_top_right_2').css('color', '#B1B0B0');
		$('.roll_star_top_right_1').css('color', '#E0E0E0');
	});

	$('.roll_down_a').hover(function() {
		$(this).css('-webkit-box-shadow','2px 5px 10px #E0E0E0')
	}, function() {
		$(this).css('-webkit-box-shadow','')
	});

	var a = 1

	function roll(){
		if (a==1) {
			$('.roll_star_buttom_1').animate({left:'-1234px'}, 500)
			$('.roll_star_top_right_1').css('color', '#B1B0B0');
			$('.roll_star_top_right_2').css('color', '#E0E0E0');
			a=0
		}else if (a==0) {
			$('.roll_star_buttom_1').animate({left:'0px'}, 500)
			$('.roll_star_top_right_2').css('color', '#B1B0B0');
			$('.roll_star_top_right_1').css('color', '#E0E0E0');
			a=1
		};
	}
	
	time1 = setInterval(roll,5000)

	$('.roll_star_top_right').hover(function() {
		clearInterval(time1)
	}, function() {
		time1 = setInterval(roll,5000)
	});

	$('.center_hardware_top_right').hover(function() {
		$('.center_hardware_top_right a').css('color','#ff6700')
		$('.center_hardware_top_right i').css('background','#ff6700')
	}, function() {
		$('.center_hardware_top_right a').css('color','')
		$('.center_hardware_top_right i').css('background','')
	});

	$(".center_hardware_down div").hover(function() {
		$(this).css('-webkit-box-shadow','2px 5px 30px #E0E0E0')
		$('.center_hardware_down_right').css('-webkit-box-shadow','')
		$(this).css('bottom','3px')
	}, function() {
		$(this).css('-webkit-box-shadow','')
		$(this).css('bottom','')
	});

	$(".center_accessories_down div").hover(function() {
		$(this).css('-webkit-box-shadow','2px 5px 30px #E0E0E0')
		$('.center_accessories_down_right').css('-webkit-box-shadow','')
		$('.center_accessories_down_right_3_up div').css('-webkit-box-shadow','')
		$('.center_accessories_down_right_3_down div').css('-webkit-box-shadow','')
		$(this).css('bottom','3px')
	}, function() {
		$(this).css('-webkit-box-shadow','')
		$(this).css('bottom','')
	});

	$(".center_fittings_down div").hover(function() {
		$(this).css('-webkit-box-shadow','2px 5px 30px #E0E0E0')
		$('.center_fittings_down_right').css('-webkit-box-shadow','')
		$('.center_fittings_down_right_3_up div').css('-webkit-box-shadow','')
		$('.center_fittings_down_right_3_down div').css('-webkit-box-shadow','')
		$(this).css('bottom','3px')
	}, function() {
		$(this).css('-webkit-box-shadow','')
		$(this).css('bottom','')
	});


	$(".center_peripheral_down div").hover(function() {
		$(this).css('-webkit-box-shadow','2px 5px 30px #E0E0E0')
		$('.center_peripheral_down_right').css('-webkit-box-shadow','')
		$('.center_peripheral_down_right_3_up div').css('-webkit-box-shadow','')
		$('.center_peripheral_down_right_3_down div').css('-webkit-box-shadow','')
		$(this).css('bottom','3px')
	}, function() {
		$(this).css('-webkit-box-shadow','')
		$(this).css('bottom','')
	});

	$(".center_hot_down div").hover(function() {
		$(this).css('-webkit-box-shadow','2px 5px 30px #E0E0E0')
		$('.center_hot_down_1').children('div').css('-webkit-box-shadow','')
		$('.center_hot_down_2').children('div').css('-webkit-box-shadow','')
		$(this).css('bottom','3px')
	}, function() {
		$(this).css('-webkit-box-shadow','')
		$(this).css('bottom','')
	});

	$(".center_content_down div").hover(function() {
		$(this).css('-webkit-box-shadow','2px 5px 30px #E0E0E0')
		$('.center_content_down_1').children('div').css('-webkit-box-shadow','')
		$('.center_content_down_2').children('div').css('-webkit-box-shadow','')
		$(this).css('bottom','3px')
	}, function() {
		$(this).css('-webkit-box-shadow','')
		$(this).css('bottom','')
	});

	$(".center_video_down div").hover(function() {
		$(this).css('-webkit-box-shadow','2px 5px 30px #E0E0E0')
		$('.center_video_down_1 div').css('-webkit-box-shadow','')
		$('.center_video_down_2 div').css('-webkit-box-shadow','')
		$(this).css('bottom','3px')
	}, function() {
		$(this).css('-webkit-box-shadow','')
		$(this).css('bottom','')
	});
})
